import json
from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.request import CommonRequest
# 创建AcsClient实例
client = AcsClient(
    "LTAI5tQuVNdyxzuHKuVDtKoU",
    "g2ADtEsn6UjPA2Ab4fz0agremAkXCY",
    "cn-hangzhou"
)
request = CommonRequest()
# domain和version是固定值
request.set_domain('alinlp.cn-hangzhou.aliyuncs.com')
request.set_version('2020-06-29')
# action name可以在API文档里查到
request.set_action_name('GetWsCustomizedChGeneral')
# 需要add哪些param可以在API文档里查到
request.add_query_param('ServiceCode', 'alinlp')
request.add_query_param('Text', '云麦好轻智能体脂秤精准蓝牙秤体重测人体脂肪秤家用称健康电子秤')
request.add_query_param('TokenizerId', 'GENERAL_CHN')
response = client.do_action_with_exception(request)
resp_obj = json.loads(response)
print(resp_obj)